From 632953a1582dceb3472ed459c03df1fbb5e0717b Mon Sep 17 00:00:00 2001 From: James Haggerty Date: Tue, 11 Mar 2025 10:46:12 +1100 Subject: [PATCH] interface: when interface properties change, reinitialise Without this, when the ip addresses on an interface changed it would no longer interact correctly with the interface. Addresses #20 Signed-off-by: Felix Fietkau --- interface.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/interface.c b/interface.c index e2f0ce9..340878e 100644 --- a/interface.c +++ b/interface.c @@ -462,12 +462,16 @@ iface_update_cb(struct vlist_tree *tree, struct vlist_node *node_new, struct interface *if_new = container_of_safe(node_new, struct interface, node); if (if_old && if_new) { - if (!iface_equal(if_old, if_new)) + bool equal = iface_equal(if_old, if_new); + if (!equal) cache_cleanup(if_old); free(if_old->addrs.v4); if_old->addrs = if_new->addrs; if_old->ifindex = if_new->ifindex; free(if_new); + + if (!equal) + interface_start(if_old); return; } -- 2.30.2